<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>学海教育 - 学生主页</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        
        :root {
            --primary: #4a6bff;
            --secondary: #6c757d;
            --success: #28a745;
            --warning: #ffc107;
            --danger: #dc3545;
            --light: #f8f9fa;
            --dark: #343a40;
            --border-radius: 8px;
            --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }
        
        body {
            background-color: #f5f7fb;
            color: #333;
            line-height: 1.6;
        }
        
        .container {
            display: flex;
            min-height: 100vh;
        }
        
        /* 侧边栏样式 */
        .sidebar {
            width: 250px;
            background: linear-gradient(to bottom, #4a6bff, #3a5bd9);
            color: white;
            padding: 20px 0;
            box-shadow: var(--box-shadow);
            z-index: 100;
        }
        
        .logo {
            display: flex;
            align-items: center;
            padding: 0 20px 20px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            margin-bottom: 20px;
        }
        
        .logo i {
            font-size: 28px;
            margin-right: 10px;
        }
        
        .logo h1 {
            font-size: 20px;
        }
        
        .nav-links {
            list-style: none;
        }
        
        .nav-links li {
            padding: 12px 20px;
            margin: 5px 0;
            cursor: pointer;
            transition: var(--transition);
            display: flex;
            align-items: center;
        }
        
        .nav-links li.active {
            background-color: rgba(255, 255, 255, 0.15);
            border-left: 4px solid white;
        }
        
        .nav-links li:hover {
            background-color: rgba(255, 255, 255, 0.1);
        }
        
        .nav-links i {
            margin-right: 12px;
            font-size: 18px;
        }
        
        /* 主内容区样式 */
        .main-content {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
        }
        
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            padding-bottom: 15px;
            border-bottom: 1px solid #eaeaea;
        }
        
        .user-info {
            display: flex;
            align-items: center;
        }
        
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: var(--primary);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: bold;
            margin-right: 10px;
        }
        
        /* 内容卡片样式 */
        .content-section {
            display: none;
        }
        
        .content-section.active {
            display: block;
            animation: fadeIn 0.5s ease;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .section-title {
            font-size: 24px;
            margin-bottom: 20px;
            color: var(--dark);
            display: flex;
            align-items: center;
        }
        
        .section-title i {
            margin-right: 10px;
            color: var(--primary);
        }
        
        .card-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
            gap: 20px;
        }
        
        .card {
            background-color: white;
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            overflow: hidden;
            transition: var(--transition);
        }
        
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
        }
        
        .card-header {
            padding: 15px;
            background-color: var(--primary);
            color: white;
        }
        
        .card-body {
            padding: 15px;
        }
        
        .card-footer {
            padding: 15px;
            border-top: 1px solid #eaeaea;
            display: flex;
            justify-content: flex-end;
        }
        
        .btn {
            padding: 8px 16px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-weight: 500;
            transition: var(--transition);
        }
        
        .btn-primary {
            background-color: var(--primary);
            color: white;
        }
        
        .btn-primary:hover {
            background-color: #3a5bd9;
        }
        
        .btn-success {
            background-color: var(--success);
            color: white;
        }
        
        .btn-success:hover {
            background-color: #218838;
        }
        
        .btn-outline {
            background-color: transparent;
            border: 1px solid var(--primary);
            color: var(--primary);
        }
        
        .btn-outline:hover {
            background-color: var(--primary);
            color: white;
        }
        
        .progress-bar {
            height: 6px;
            background-color: #e9ecef;
            border-radius: 3px;
            margin: 10px 0;
            overflow: hidden;
        }
        
        .progress {
            height: 100%;
            background-color: var(--success);
            border-radius: 3px;
        }
        
        .chapter-list {
            list-style: none;
            margin-top: 15px;
        }
        
        .chapter-item {
            padding: 10px;
            border-bottom: 1px solid #eaeaea;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .chapter-item:last-child {
            border-bottom: none;
        }
        
        .status-badge {
            padding: 4px 8px;
            border-radius: 20px;
            font-size: 12px;
            font-weight: 500;
        }
        
        .status-completed {
            background-color: #e8f5e9;
            color: var(--success);
        }
        
        .status-pending {
            background-color: #fff3e0;
            color: #ff9800;
        }
        
        .assignment-details {
            margin-top: 15px;
        }
        
        .assignment-info {
            display: flex;
            justify-content: space-between;
            margin-bottom: 10px;
        }
        
        .assignment-info span {
            font-weight: 500;
        }
        
        .course-card {
            position: relative;
        }
        
        .course-badge {
            position: absolute;
            top: 15px;
            right: 15px;
            background-color: var(--warning);
            color: var(--dark);
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: 500;
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .container {
                flex-direction: column;
            }
            
            .sidebar {
                width: 100%;
                padding: 10px 0;
            }
            
            .nav-links {
                display: flex;
                justify-content: space-around;
            }
            
            .nav-links li {
                flex-direction: column;
                text-align: center;
                padding: 10px;
                font-size: 14px;
            }
            
            .nav-links li.active {
                border-left: none;
                border-bottom: 3px solid white;
            }
            
            .nav-links i {
                margin-right: 0;
                margin-bottom: 5px;
            }
            
            .card-container {
                grid-template-columns: 1fr;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <!-- 侧边导航栏 -->
        <div class="sidebar">
            <div class="logo">
                <i class="fas fa-graduation-cap"></i>
                <h1>学海教育</h1>
            </div>
            <ul class="nav-links">
                <li class="active" data-target="my-courses">
                    <i class="fas fa-book-open"></i>
                    <span>我的课程</span>
                </li>
                <li data-target="my-assignments">
                    <i class="fas fa-tasks"></i>
                    <span>我的作业</span>
                </li>
                <li data-target="course-selection">
                    <i class="fas fa-plus-circle"></i>
                    <span>去选课</span>
                </li>
            </ul>
        </div>
        
        <!-- 主内容区 -->
        <div class="main-content">
            <div class="header">
                <h2>学生主页</h2>
                <div class="user-info">
                    <div class="user-avatar">张</div>
                    <span>张三同学，欢迎回来！</span>
                </div>
            </div>
            
            <!-- 我的课程 -->
            <div class="content-section active" id="my-courses">
                <h3 class="section-title">
                    <i class="fas fa-book-open"></i>
                    我的课程
                </h3>
                
                <div class="card-container">
                    <!-- 课程1 -->
                    <div class="card">
                        <div class="card-header">
                            <h4>高等数学</h4>
                            <p>王教授 · 已完成 65%</p>
                        </div>
                        <div class="card-body">
                            <div class="progress-bar">
                                <div class="progress" style="width: 65%"></div>
                            </div>
                            <p>本课程涵盖微积分、线性代数和概率统计等高等数学核心内容。</p>
                            
                            <ul class="chapter-list">
                                <li class="chapter-item">
                                    <span>第一章：函数与极限</span>
                                    <span class="status-badge status-completed">已完成</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第二章：导数与微分</span>
                                    <span class="status-badge status-completed">已完成</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第三章：积分学</span>
                                    <span class="status-badge status-completed">已完成</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第四章：多元函数</span>
                                    <span class="status-badge status-pending">进行中</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第五章：无穷级数</span>
                                    <span class="status-badge status-pending">未开始</span>
                                </li>
                            </ul>
                        </div>
                        <div class="card-footer">
                            <button class="btn btn-primary">进入课程</button>
                        </div>
                    </div>
                    
                    <!-- 课程2 -->
                    <div class="card">
                        <div class="card-header">
                            <h4>Java程序设计</h4>
                            <p>李教授 · 已完成 40%</p>
                        </div>
                        <div class="card-body">
                            <div class="progress-bar">
                                <div class="progress" style="width: 40%"></div>
                            </div>
                            <p>从基础语法到面向对象编程，全面掌握Java开发技能。</p>
                            
                            <ul class="chapter-list">
                                <li class="chapter-item">
                                    <span>第一章：Java基础</span>
                                    <span class="status-badge status-completed">已完成</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第二章：面向对象</span>
                                    <span class="status-badge status-completed">已完成</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第三章：集合框架</span>
                                    <span class="status-badge status-pending">进行中</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第四章：IO流</span>
                                    <span class="status-badge status-pending">未开始</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第五章：多线程</span>
                                    <span class="status-badge status-pending">未开始</span>
                                </li>
                            </ul>
                        </div>
                        <div class="card-footer">
                            <button class="btn btn-primary">进入课程</button>
                        </div>
                    </div>
                    
                    <!-- 课程3 -->
                    <div class="card">
                        <div class="card-header">
                            <h4>英语写作</h4>
                            <p>陈教授 · 已完成 20%</p>
                        </div>
                        <div class="card-body">
                            <div class="progress-bar">
                                <div class="progress" style="width: 20%"></div>
                            </div>
                            <p>提升英语写作能力，掌握各类文体写作技巧。</p>
                            
                            <ul class="chapter-list">
                                <li class="chapter-item">
                                    <span>第一章：句子结构</span>
                                    <span class="status-badge status-completed">已完成</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第二章：段落写作</span>
                                    <span class="status-badge status-pending">进行中</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第三章：议论文写作</span>
                                    <span class="status-badge status-pending">未开始</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第四章：说明文写作</span>
                                    <span class="status-badge status-pending">未开始</span>
                                </li>
                                <li class="chapter-item">
                                    <span>第五章：学术论文写作</span>
                                    <span class="status-badge status-pending">未开始</span>
                                </li>
                            </ul>
                        </div>
                        <div class="card-footer">
                            <button class="btn btn-primary">进入课程</button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 我的作业 -->
            <div class="content-section" id="my-assignments">
                <h3 class="section-title">
                    <i class="fas fa-tasks"></i>
                    我的作业
                </h3>
                
                <div class="card-container">
                    <!-- 作业1 -->
                    <div class="card">
                        <div class="card-header">
                            <h4>高等数学 - 作业三</h4>
                            <p>截止日期: 2023-10-15</p>
                        </div>
                        <div class="card-body">
                            <p>完成第三章课后习题，包括计算题和应用题。</p>
                            
                            <div class="assignment-details">
                                <div class="assignment-info">
                                    <span>状态:</span>
                                    <span class="status-badge status-completed">已提交</span>
                                </div>
                                <div class="assignment-info">
                                    <span>提交时间:</span>
                                    <span>2023-10-12</span>
                                </div>
                                <div class="assignment-info">
                                    <span>得分:</span>
                                    <span>92/100</span>
                                </div>
                            </div>
                        </div>
                        <div class="card-footer">
                            <button class="btn btn-outline">查看详情</button>
                        </div>
                    </div>
                    
                    <!-- 作业2 -->
                    <div class="card">
                        <div class="card-header">
                            <h4>Java程序设计 - 实验二</h4>
                            <p>截止日期: 2023-10-20</p>
                        </div>
                        <div class="card-body">
                            <p>实现一个简单的学生信息管理系统，包含增删改查功能。</p>
                            
                            <div class="assignment-details">
                                <div class="assignment-info">
                                    <span>状态:</span>
                                    <span class="status-badge status-pending">进行中</span>
                                </div>
                                <div class="assignment-info">
                                    <span>剩余时间:</span>
                                    <span>5天</span>
                                </div>
                                <div class="assignment-info">
                                    <span>要求:</span>
                                    <span>提交源代码和文档</span>
                                </div>
                            </div>
                        </div>
                        <div class="card-footer">
                            <button class="btn btn-primary">提交作业</button>
                        </div>
                    </div>
                    
                    <!-- 作业3 -->
                    <div class="card">
                        <div class="card-header">
                            <h4>英语写作 - 作文一</h4>
                            <p>截止日期: 2023-10-25</p>
                        </div>
                        <div class="card-body">
                            <p>写一篇关于"我的大学生活"的英语短文，不少于300词。</p>
                            
                            <div class="assignment-details">
                                <div class="assignment-info">
                                    <span>状态:</span>
                                    <span class="status-badge status-pending">未开始</span>
                                </div>
                                <div class="assignment-info">
                                    <span>剩余时间:</span>
                                    <span>10天</span>
                                </div>
                                <div class="assignment-info">
                                    <span>要求:</span>
                                    <span>Word文档格式</span>
                                </div>
                            </div>
                        </div>
                        <div class="card-footer">
                            <button class="btn btn-outline">开始写作</button>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 去选课 -->
            <div class="content-section" id="course-selection">
                <h3 class="section-title">
                    <i class="fas fa-plus-circle"></i>
                    去选课
                </h3>
                
                <div class="card-container">
                    <!-- 可选课程1 -->
                    <div class="card course-card">
                        <div class="course-badge">热门</div>
                        <div class="card-header">
                            <h4>Python数据分析</h4>
                            <p>张教授 · 32课时</p>
                        </div>
                        <div class="card-body">
                            <p>学习使用Python进行数据清洗、分析和可视化，掌握Pandas、NumPy等库的使用。</p>
                            
                            <div class="assignment-details">
                                <div class="assignment-info">
                                    <span>开课时间:</span>
                                    <span>2023-11-01</span>
                                </div>
                                <div class="assignment-info">
                                    <span>难度:</span>
                                    <span>中级</span>
                                </div>
                                <div class="assignment-info">
                                    <span>已报名:</span>
                                    <span>245人</span>
                                </div>
                            </div>
                        </div>
                        <div class="card-footer">
                            <button class="btn btn-success">立即选课</button>
                        </div>
                    </div>
                    
                    <!-- 可选课程2 -->
                    <div class="card course-card">
                        <div class="course-badge">新课程</div>
                        <div class="card-header">
                            <h4>人工智能导论</h4>
                            <p>刘教授 · 40课时</p>
                        </div>
                        <div class="card-body">
                            <p>了解人工智能的基本概念、发展历程和主要应用领域，入门机器学习算法。</p>
                            
                            <div class="assignment-details">
                                <div class="assignment-info">
                                    <span>开课时间:</span>
                                    <span>2023-11-15</span>
                                </div>
                                <div class="assignment-info">
                                    <span>难度:</span>
                                    <span>初级</span>
                                </div>
                                <div class="assignment-info">
                                    <span>已报名:</span>
                                    <span>189人</span>
                                </div>
                            </div>
                        </div>
                        <div class="card-footer">
                            <button class="btn btn-success">立即选课</button>
                        </div>
                    </div>
                    
                    <!-- 可选课程3 -->
                    <div class="card course-card">
                        <div class="card-header">
                            <h4>网页设计与开发</h4>
                            <p>赵教授 · 36课时</p>
                        </div>
                        <div class="card-body">
                            <p>学习HTML、CSS和JavaScript，掌握响应式网页设计和前端开发技能。</p>
                            
                            <div class="assignment-details">
                                <div class="assignment-info">
                                    <span>开课时间:</span>
                                    <span>2023-10-30</span>
                                </div>
                                <div class="assignment-info">
                                    <span>难度:</span>
                                    <span>初级</span>
                                </div>
                                <div class="assignment-info">
                                    <span>已报名:</span>
                                    <span>312人</span>
                                </div>
                            </div>
                        </div>
                        <div class="card-footer">
                            <button class="btn btn-success">立即选课</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 选项卡切换功能
        document.addEventListener('DOMContentLoaded', function() {
            const navLinks = document.querySelectorAll('.nav-links li');
            const contentSections = document.querySelectorAll('.content-section');
            
            navLinks.forEach(link => {
                link.addEventListener('click', function() {
                    const targetId = this.getAttribute('data-target');
                    
                    // 更新活跃导航项
                    navLinks.forEach(item => item.classList.remove('active'));
                    this.classList.add('active');
                    
                    // 显示对应内容区域
                    contentSections.forEach(section => {
                        section.classList.remove('active');
                        if (section.id === targetId) {
                            section.classList.add('active');
                        }
                    });
                });
            });
            
            // 模拟作业提交功能
            const submitButtons = document.querySelectorAll('.btn-primary');
            submitButtons.forEach(button => {
                if (button.textContent === '提交作业') {
                    button.addEventListener('click', function() {
                        alert('作业提交成功！');
                        // 在实际应用中，这里会有文件上传和表单提交逻辑
                    });
                }
            });
            
            // 模拟选课功能
            const selectButtons = document.querySelectorAll('.btn-success');
            selectButtons.forEach(button => {
                button.addEventListener('click', function() {
                    const courseName = this.closest('.card').querySelector('h4').textContent;
                    alert(`成功选课：${courseName}`);
                    // 在实际应用中，这里会有选课API调用
                });
            });
        });
    </script>
</body>
</html>